//
//  YCNormalPickerViewViewController.m
//  DemoPickerView
//
//  Created by tangkexiong on 16/3/9.
//  Copyright © 2016年 tangkexiong. All rights reserved.
//

#import "YCNormalPickerViewViewController.h"

#import "YCNormalPickerView.h"

@interface YCNormalPickerViewViewController ()<YCNormalPickerViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate>

@end

@implementation YCNormalPickerViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (IBAction)chooseBtnClicked:(id)sender {
    YCNormalPickerView *pickerView = [YCNormalPickerView instanceWithDelegate:self];
    
    [pickerView show];
}

#pragma mark - YCNormalPickerViewDelegate

- (void)normalPickerViewWillShow:(YCNormalPickerView *)pickerView {
    pickerView.pickerView.dataSource = self;
    pickerView.pickerView.delegate = self;
}

- (void)normalPickerViewDidCommit:(YCNormalPickerView *)pickerView {
    
}

#pragma mark - UIPickerViewDataSource, UIPickerViewDelegate

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    return 10;
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
    return [NSString stringWithFormat:@"坐标(%i, %i)", (int)component, (int)row];
}

@end
